<%@page language="java"  contentType="text/html;charset=utf-8" import="java.util.*,com.zjut.an.config.manager.*, com.zjut.an.config.dao.*, com.zjut.an.news.manager.*,com.zjut.an.news.dao.*,com.zjut.an.util.tools.*"%>
<%
HTMLCreat html = (HTMLCreat) SpringContextUtil.getBean("HTMLCreat");
AnNewsManager manager = (AnNewsManager) SpringContextUtil.getBean("AnNewsManager");
HitUtil hitUtil = (HitUtil) SpringContextUtil.getBean("HitUtil");

Count count = (Count) SpringContextUtil.getBean("Count");

int neId = Integer.parseInt(request.getParameter("neId").trim());//新闻参数

if (neId==0) {
	count.getGuestCount(this.getServletContext().getRealPath("/")+"apply/count.txt");
} else  if (request.getParameter("count")!=null && request.getParameter("count").equals("true")){
	//AnNews rnews = manager.getData(neId);
	//int olderHit=rnews.getHit();
	//int newHit=olderHit+1;
	//rnews.setHit(newHit);
	//manager.updateData(rnews);
	int newHit = hitUtil.hit(neId);
	out.print("document.write("+newHit+");");

} else {
	int newHit = hitUtil.getHit(neId);
	out.print("document.write("+newHit+");");
}
%>